package unm.excel

class PageExcel extends AbstractExcel {
    String type
    String pageName
    String title
    String status

    static List<PageExcel> load() {
        def sheet = getSheet('page_name_data.xls', 'page')
        def lastRowNum = sheet.getLastRowNum() // begin at 0

        def list = []
        for (int i = 1; i <= lastRowNum; i++) {
            def row = sheet.getRow(i)
            def type = row.getCell(0)?.stringCellValue
            def pageName = row.getCell(1)?.stringCellValue
            def title = row.getCell(2)?.stringCellValue
            def status = row.getCell(3)?.stringCellValue
            list << new PageExcel(type: type, pageName: pageName, title: title, status: status)
        }
        return list
    }
}
